// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import Qt 4.7

Item {
    width: pro_width
    height: pro_height

    property int pro_width: 200
    property int pro_height: 80
    property string textstring: ""
    property int text_size: 44
    property string main_color: "white"
    property string press_color: "black"
    property bool isEnable: true

    signal buttonclick()

    Rectangle {
        id: button_main
        color: "#00000000"
        border.width: 2
        border.color: main_color
        anchors.rightMargin: 5
        anchors.leftMargin: 5
        anchors.bottomMargin: 5
        anchors.topMargin: 5
        anchors.fill: parent

        Text {
            id: buttontext
            color: main_color
            text: textstring
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.verticalCenter: parent.verticalCenter
            font.pixelSize: text_size
        }
    }

    MouseArea {
        id: mouse_area1
        anchors.fill: parent
        enabled: isEnable

//        onPressed:
//        {
//            button_main.color = "white";
////            button_main.border.color = "white";
//            buttontext.color = "black";
//        }

//        onReleased:
//        {
//            button_main.color = "#00000000";
////            button_main.border.color = "black";
//            buttontext.color = "white";
//        }

        onClicked:
        {
            buttonclick();
        }
    }

    states: State {
        name: "pressed"
        when: mouse_area1.pressed

        PropertyChanges {
            target: button_main
            color: main_color
        }

        PropertyChanges {
            target: buttontext
            color: press_color
        }
    }
}
